/**
 * Copyright (c) 2018-2028, HQY 胡庆一 (215218393@qq.com).
 * <p>
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ocm.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocm.product.dto.AttrValueDTO;
import com.ocm.product.entity.AttrValue;
import com.ocm.product.vo.AttrValueVO;
import com.ocm.product.mapper.AttrValueMapper;
import com.ocm.product.service.IAttrValueService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 *  服务实现类
 *
 * @author HQY
 * @since 2021-11-19
 */
@Service
public class AttrValueServiceImpl extends ServiceImpl<AttrValueMapper, AttrValue> implements IAttrValueService {


	@Override
	public List<AttrValueVO> selectAttrValue(QueryWrapper<AttrValueVO> queryWrapper) {
		return baseMapper.selectAttrValuePage(null, queryWrapper);
	}

	@Override
	public IPage<AttrValueVO> selectAttrValuePage(IPage<AttrValueVO> page, QueryWrapper<AttrValueVO> queryWrapper) {
		return page.setRecords(baseMapper.selectAttrValuePage(page, queryWrapper));
	}
	@Override
	public List<AttrValueDTO> selectAttrSaleBySpuId(@NotNull Long spuId){
		return baseMapper.selectAttrSaleBySpuId(spuId);
	}
}
